#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	if(n>=0) cout<<n<<endl;
	else 
	{
		int a,b;
		a = (-n)%10;
		b = ((-n)/10)%10;
		if(a>=b) n = n/10;
		else n = (n/100)*10-a;
		cout<<n<<endl;
	}
}
